No problem

open terminal.

First type these two lines
sudo nano relay.py (and paste in relay code)
sudo nano switch.sh (and paste in switch code)

Then
sudo chmod +x /home/pi/relay.py
sudo chmod +x /home/pi/switch.sh

Then
sudo nano /etc/rc.local

And write these two linea before exit0
python /home/pi/relay.py &
sudo /home/pi/switch.sh &

Finally
sudo reboot


Now it should all work if your wirring is corrent 

